import request from '@/utils/request'

// 安装授权链接URL
export function getInstallUrl(data: any) {
  return request({
    url: '/scrm-api/console/install/get-link',
    method: 'GET',
    params: data
  })
}

// 渠道配置状态查询
export function getChannelConfigState() {
  return request({
    url: '/scrm-api/console/tenant/corp/auth-status',
    method: 'GET'
  })
}

// 渠道配置信息查询
export function getChannelConfigInfo() {
  return request({
    url: '/scrm-api/console/tenant/corp/auth-info',
    method: 'GET'
  })
}

// 设置通讯录Secret
export function setContactSecret(data: any) {
  return request({
    url: '/scrm-api/console/tenant/corp/set-addressbook-secret',
    method: 'POST',
    params: data
  })
}

// 设置客户联系Secret
export function setCustomerSecret(data: any) {
  return request({
    url: '/scrm-api/console/tenant/corp/set-customer-secret',
    method: 'POST',
    params: data
  })
}
export function channelConfigInfo() {
  return request({
    url: '/scrm-api/console/tenant/corp/auth-info',
    method: 'GET'
  })
}
// 外链 参数唯一
export function commonLink(params: any) {
  return request({
    url: '/scrm-api/console/common/doc_link',
    params
  })
}

// 外链 可传多个参数
// kyd_guide: 客易达配置引导 
// check_process_develop_doc: 《开发者入住流程及API接口文档说明》 
// user_behaviour_doc: 用户行为功能介绍 
// kyd_view_shop_id: 如何查看客易达店铺ID 
// youzan_view_shop_id: 如何查看店铺KDTID 
// youzhan_buy_app: 去购买 
// youzhan_view_applet_id: 如何查看小程序AppId
export function commonLinkList(data: any) {
  return request({
    url: '/scrm-api/console/common/doc_link_list',
    method: 'POST',
    params: data
  })
}
